<template>
	<view>
		<uni-popup ref="message" type="dialog">
			<uni-popup-dialog :mode="props.mode" :title="props.msgParams.title" :value="props.value"
				:placeholder="props.msgParams.placeholder" @confirm="e=>emits('iceClose',e?e:'confirm')"></uni-popup-dialog>
		</uni-popup>
	</view>
</template>
<script setup>
	import {
		reactive,
		ref,
		watch
	} from "vue";
	const emits = defineEmits(['iceClose'])
	const props = defineProps({
		msgParams: {
			type: Object
		},
		mode:{
			type: String,
			default: 'base'
		},
		value:{
			type:String,
			default: ''
		}
	})
	const message = ref(null)
	watch(
		() => props.msgParams.isOpen,
		(n) => {
			if (n) {
				message.value.open()
			}
		}, {
			immediate: true,
			deep: true
		}
	)
</script>

<style scoped>
	/deep/ .uni-popup uni-view:nth-child(2){
		top:-200px !important;
	}
</style>